package com.it.controller;

import com.it.mapper.ConfigMapper;
import com.it.pojo.Config;
import com.it.service.ConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ConfigController {

    @Autowired
    private ConfigService configService;

    @RequestMapping("/getConfig")
    public Config getConfig() {
        return configService.get();
    }

    @RequestMapping("/updateConfig")
    public void updateConfig(@RequestBody Config config) {
        configService.update(config);
    }

}
